﻿@model object


@{
    RouteValueDictionary data;
    if (ViewData["Attributes"] != null)
    {
        data = HtmlHelper.AnonymousObjectToHtmlAttributes(ViewData["Attributes"]);
        if (data.ContainsKey("class"))
        {
            data["class"] += " text";
        }
        else
        {
            data["class"] = "text";
        }
    }
    else
    {
        data = new RouteValueDictionary(){{"class", "text"}};
    }
}

@Html.TextBoxFor(m => m, data)